package com.ludaxu.google.tools;

import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;

public class ViewUtils {
	public static void removeParent(View view) {
		// 先找到爹,在通过爹去移除孩子
		ViewParent parent = view.getParent();
		// 所有的控件都有爹,一般情况下都是viewgroup,最前的爹是整个屏幕,不是viewgroup
		if (parent instanceof ViewGroup) {
			ViewGroup group = (ViewGroup) parent;
			group.removeView(view);
		}

	}

}
